package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1/sensitive")
public class AdSensitiveController {
    @Autowired
    private IWemediaClient iWemediaClient;
    /**
     * 删除敏感词
     * @param id
     * @return
     */
    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitive(@PathVariable("id") Integer id){
        return iWemediaClient.deleteSensitive(id);
    }
    /**
     * 查询敏感词列表
     */
    @PostMapping("/list")
    public ResponseResult findList(@RequestBody SensitiveDto dto){
        return iWemediaClient.findList(dto);
    }

    /**
     * 新增敏感词
     * @param wmSensitive
     * @return
     */
    @PostMapping("/save")
    public ResponseResult saveSensitive(@RequestBody WmSensitive wmSensitive){
        return iWemediaClient.saveSensitive(wmSensitive);
    }

    /**
     * 修改敏感词
     * @param wmSensitive
     * @return
     */
    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitive wmSensitive){
        return iWemediaClient.updateSensitive(wmSensitive);
    }
}
